//
//  WFNewestChannelTableViewCell.m
//  FAKER
//
//  Created by Jianwei on 15/11/10.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "WFNewestChannelTableViewCell.h"
#import "FitHeader.h"
#import "AllHeader.h"
@implementation WFNewestChannelTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createTableViewCell];
    }
    return self;
}
- (void)createTableViewCell
{
    _plusImageView = [[BaseClassImageView alloc]initWithFrame:CGRectMake(340 * FITWIDTH, 40, 20, 20)];
    [CONTENT_VIEW addSubview:_plusImageView];
    _plusImageView.image = [UIImage imageNamed:@"common_icon_subscribe@3x"];
}
- (void)setNewestModel:(WFSecondChannelListModel *)newestModel
{
    _newestModel = newestModel;
    [self.pic_imageView sd_setImageWithURL:[NSURL URLWithString:_newestModel.pic] placeholderImage:[UIImage imageNamed:@"PlaceHolder"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        self.pic_imageView.image = [image imageWithColor:[UIColor RGBFromHexColor:_newestModel.block_color]];
        if (NSUSERDEFAULTS_NIGHT) {
            self.pic_imageView.image = [image imageWithColor:[UIColor lightGrayColor]];
        }
    }];
    self.titleLabel.text = _newestModel.title;
//    self.backView.layer.borderColor = [UIColor RGBFromHexColor:_newestModel.block_color].CGColor;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(self.pic_imageView.X + self.pic_imageView.WIDTH + 30 * FITWIDTH, 40 * FITHEIGHT, 200 * FITWIDTH, 20 * FITHEIGHT);
    self.backView.layer.borderColor = [UIColor RGBFromHexColor:_newestModel.block_color].CGColor;
    
    if (NSUSERDEFAULTS_NIGHT) {
        self.titleLabel.layer.borderColor = [UIColor lightGrayColor].CGColor;
        self.backView.layer.borderColor = [UIColor lightGrayColor].CGColor;
    }
}
//@property(nonatomic, strong)BaseClassImageView *pic_imageView;
//@property(nonatomic, strong)BaseClassLabel *titleLabel;
//@property(nonatomic, strong)BaseClassLabel *stitleLabel;
//@property(nonatomic, strong)WFSelectedModel *model;
//@property(nonatomic, strong)BaseClassView *backView;

@end
